package A1_贪心算法;

public class LC_122买卖股票最佳时机II {
    public int maxProfit(int[] prices) {
        int result=0;
        for(int i=1;i<prices.length;i++)
            result+=Math.max(prices[i]-prices[i-1],0);
        return result;
    }
}
